<template>
  <div class="item" data-type="upatta" v-bind:class="[('w'+obj.property.selfWidth)]">
      <div class="hd" v-bind:class="[('i'+obj.property.titleWidth+'d6')]">
        <label class="tit">{{obj.property.title}}</label>
        <span class="required" v-show="obj.property.required">*</span>
        <span class="block muted">{{obj.property.intro}}</span>
        <v-handle v-bind:handle="obj.handle"></v-handle>
      </div>
      <div class="bd" v-bind:class="[('i'+(obj.property.titleWidth==6?6:6-obj.property.titleWidth)+'d6')]">
        <el-upload
          class="upload-file"
          action="https://jsonplaceholder.typicode.com/posts/"
          :on-preview="handlePreview"
          :on-remove="handleRemove"
          :before-remove="beforeRemove"
          multiple
          :limit="obj.property.upfile.fileCount"
          :on-exceed="handleExceed"
          :file-list="fileList"
          :disabled="isEdit">
          <el-button size="small" type="primary">点击上传</el-button>
        </el-upload>
      </div>
    </div>
</template>

<script>
export default {
  props: ['obj'], 
  data() {
    return {
      fileList: [],
      isEdit:this.$route.path=='/main'
    };
  },
  methods:{
    handleRemove(file, fileList) {
        console.log(file, fileList);
    },
    handlePreview(file) {
      console.log(file);
    },
    handleExceed(files, fileList) {
      
    },
    beforeRemove(file, fileList) {
      
    }
  }
}
</script>
